﻿namespace Api.Controllers
{
    /// <summary>
    /// 权限
    /// </summary>
    public class PermissionController : EditingBaseController<PermissionModel, PermissionFilterModel, IPermissionLogic>
    {
        public PermissionController(ICurrentUser currentUser, IPermissionLogic logic)
            : base(currentUser, logic)
        {
        }

        #region 获取所有权限的树形结构数据
        [HttpGet]
        public async Task<List<PermissionModel>> GetTreePermission()
        {
            return await Task.Run(() => _logic.GetTreePermission());
        }
        #endregion

        #region 获取所有监管部门权限的树形结构数据
        [HttpGet]
        public async Task<List<PermissionModel>> GetTreePermissionByRegulator()
        {
            return await Task.Run(() => _logic.GetTreePermissionByRegulator());
        }
        #endregion
    }
}
